#include "cauthinfo.h"

bool CAuthInfo::compare(const CAuthInfo &first, const CAuthInfo &second)
{
    return (first.d.networkId == second.d.networkId
            && first.d.host == second.d.host
            && first.d.domain == second.d.domain
            && first.d.resource == second.d.resource
            && first.d.user == second.d.user
            && first.d.password == second.d.password);
}

bool CAuthInfo::operator ==(const CAuthInfo &other)
{
    return compare(*this, other);
}

bool CAuthInfo::operator !=(const CAuthInfo &other)
{
    return !compare(*this, other);
}

CAuthInfo::CAuthInfo(const CAuthInfo &other)
{
    d = other.d;
}

CAuthInfo::CAuthInfo(QObject *parent)
    : QObject(parent)
{

}

QString CAuthInfo::networkId() const
{
    return d.networkId;
}

void CAuthInfo::setNetworkId(const QString &i)
{
    d.networkId = i;
}

QString CAuthInfo::host() const
{
    return d.host;
}

void CAuthInfo::setHost(const QString &host)
{
    d.host = host;
}

QString CAuthInfo::domain() const
{
    return d.domain;
}

void CAuthInfo::setDomain(const QString &domain)
{
    d.domain = domain;
}

QString CAuthInfo::resource() const
{
    return d.resource;
}

void CAuthInfo::setResource(const QString &resource)
{
    d.resource = resource;
}

QString CAuthInfo::user() const
{
    return d.user;
}

void CAuthInfo::setUser(const QString &user)
{
    d.user = user;
}

QString CAuthInfo::password() const
{
    return d.password;
}

void CAuthInfo::setPassword(const QString &password)
{
    d.password = password;
}

int CAuthInfo::port() const
{
    return d.port;
}

void CAuthInfo::setPort(int port)
{
    d.port = port;
}
